'''
Created on Jul 21, 2013

@author: Cihat Basol
'''


import cPickle


class TaskMeta(object):
    def __init__(self, job_name, task_name, task_func, task_cond=None, 
                input_size=None, task_event=None):
        self.job_name = job_name
        self.task_name = task_name
        self._task_func = cPickle.dumps(task_func)
        self._task_cond = cPickle.dumps(task_cond)
        self._task_event = cPickle.dumps(task_event)
        self.input_size = input_size
    
    @property
    def task_func(self):
        return cPickle.loads(self._task_func)

    @property
    def task_cond(self):
        return cPickle.loads(self._task_cond)
    
    @property
    def task_event(self):
        return cPickle.loads(self._task_event)
